<%@page contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false"%> 
<%@ taglib prefix="authz" uri="/WEB-INF/tld/authz.tld" %> 
<%@ page import="com.qingneng.budget.security.CurrentUser" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>庆能(北京)化粪池环境处理预算平台</title>
	
<%@ include file="common.jsp"%>
<style type="text/css">


#menu { font:12px verdana, arial, sans-serif; }
#menu, #menu li {list-style:none;padding:0;margin:0;}
#menu li { float:top; width:60px}
#menu li a {display:block; padding:5px 50px;background:#E8E7EA;color:#4545FD;text-decoration:none;border-right:1px solid #000;width:60px}
#menu li a:hover {background:#146C9C;color:#fff;text-decoration:none;border-right:1px solid #000;}
#menu li a.last {border-right:0; }


</style>
	
<script type="text/javascript">
	//注销
	function _logout(){
		 $.messager.confirm('提示','您确认是否退出系统?',function(r){  
		      if (r){  
		    	  window.location.href='<%=basePath%>login.jsp';
		      }  
		  }); 
	}
	
 	$(function(){
		 $('#main-info').panel({ 
			 tools: [{ 	
			 iconCls:'icon-back' ,
			 handler:function(){				
				 $.messager.confirm('提示','您确认是否退出系统?',function(r){  
					      if (r){  
					    	  window.location.href='<%=basePath%>login.jsp';
					      }  
					  }); 
  
				 } 
	
			 }] 
	
			}); 
		}) 


		$(function(){
			var p = $('body').layout('panel','west').panel({
				onCollapse:function(){
					//alert('collapse');
				}
			});
			setTimeout(function(){
				$('body').layout('collapse','east');
			},0);
		});
		
		//导航添加tab页
		function navigationTab(title, url){   
    	if ($('#tt').tabs('exists', title)){   
        $('#tt').tabs('select', title);   
    	} else {   
        	var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';   
        $('#tt').tabs('add',{   
            title:title,   
            content:content,   
            closable:true  
        });   
    	}   
	  } 
		
</script>
</head>

<%
	String account = "";
	String companyname = "";
	String username = "";
	if(CurrentUser.getUser()!=null){
		 account = CurrentUser.getUser().getUseraccount();
		 username= CurrentUser.getUser().getUsername();
		 companyname = CurrentUser.getUser().getCompanyName();
	}

%>


<body class="easyui-layout">
	<div region="north" border="false" style="height:69px;background:#B3DFDA;padding:1px">
		<table width="100%"  height="50px" border="0">
			<tr>
			 
				<td width="72%"><img alt="" src="<%=imgPath %>main/top_qingneng.jpg" height="60px" ></td>	
			     <td >
			     <table border="0" width="350" cellpadding="0" cellspacing="0">
			     	<tr>
			     	<td width="80"> <img alt="" src="<%=imgPath %>user_suit.png" >&nbsp;&nbsp;操作人:<%=account %>(<%=username%>)</td>
			     	<td width="80"> <img alt="" src="<%=imgPath %>login/topo.gif" >&nbsp;&nbsp;所属机构:<%=companyname %></td>
			     	<td width="20"><a href="<%=basePath%>jsp/common/logout.jsp">退出</a></td>
			     	<!--  
			     	<td width="30" ><a href="javascript:void(0)" onclick='modifyPsw()'>修改密码</a></td>
			     	-->
			      </tr>
			     </table>
			     
			   
			     </td>
				
			</tr>
			
		
		</table>
		
		
	</div>
	<div region="west" split="true" title="操作区" style="width:170px;padding:1px;">
	
	<div class="easyui-accordion"  border="false">
			<div title="预算信息" style="width:100%;overflow:auto;">	
			<ul id="menu" >  
            <li><a href="javascript:void(0)" onclick="navigationTab('合同信息','<%=basePath %>jsp/moduel/budget_info/ct_info.jsp')">合同信息</a></li>  
            <li><a href="javascript:void(0)" onclick="navigationTab('项目与工程','<%=basePath %>jsp/moduel/budget_info/project_info.jsp')">项目与工程</a></li>  
          
        	</ul> 
								
			</div>
			<div title="预算编制">
				
			<ul id="menu" >  
            <li><a href="javascript:void(0)" onclick="navigationTab('预算编制','<%=basePath %>jsp/moduel/budget_do/project_budget_do.jsp')">预算编制</a></li>
            <li><a href="javascript:void(0)" onclick="navigationTab('预算审核','<%=basePath %>jsp/moduel/budget_do/project_budget_audit.jsp')">预算审核</a></li>
            <li><a href="javascript:void(0)" onclick="navigationTab('预算报价单','<%=basePath %>jsp/moduel/budget_do/budget_sheet.jsp')">预算报价单</a></li>  
        	</ul> 
				
			</div>
			
			<div title="合同签订">
				
			<ul id="menu" >  
            <li><a href="javascript:void(0)" onclick="navigationTab('合同价录入','<%=basePath %>jsp/moduel/sign/contractPriceEntering.jsp')">合同价录入</a></li>  
        	</ul> 
				
			</div>
			
			<div title="报表查询" >
			<ul id="menu">  
            <li><a href="javascript:void(0)" onclick="navigationTab('工程预算表','<%=basePath %>jsp/moduel/budget_report/statistic_info.jsp')">报表统计</a></li>  
        	</ul>
			</div>
		<authz:authorize ifAllGranted="ROLE_ADMIN">	
			<div title="系统管理" >
			<ul id="menu" > 
			 <li><a href="javascript:void(0)" onclick="navigationTab('机构管理','<%=basePath %>jsp/moduel/admin/companyInfo.jsp')">机构管理</a></li>   
            <li><a href="javascript:void(0)" onclick="navigationTab('用户管理','<%=basePath %>jsp/moduel/admin/userInfo.jsp')">用户管理</a></li>
             <li><a href="javascript:void(0)" onclick="navigationTab('角色管理','<%=basePath %>jsp/moduel/admin/roleInfo.jsp')">角色管理</a></li> 
             <li><a href="javascript:void(0)" onclick="navigationTab('权限管理','<%=basePath %>jsp/moduel/admin/authInfo.jsp')">权限管理</a></li>      
            <li><a href="javascript:void(0)" onclick="navigationTab('日志管理','http://www.baidu.com/')">日志管理</a></li>  
        	</ul>
			</div>
		</authz:authorize>		
		</div>
		
	</div>
	<div region="east" split="true" title="East" style="width:100px;padding:10px;"></div>
		
	<div region="south" border="false" style="height:40px;background:#A9FACD;padding:10px;" align="center">
		Copyright © 2012  庆能环境. All Rights Reserved
	</div>
	
	
	<div region="center" title="信息区" id="main-info" >
		<div class="easyui-tabs" fit="true" border="false" id="tt">
			<div title="首页" style="padding:10px;overflow:hidden;">
				<div >
					<iframe scrolling="auto" frameborder="0"  src="<%=basePath %>jsp/common/main_home.jsp" 
					style="width:100%;height:400px"></iframe>
				</div>
			</div>
		</div>
	</div>
	

<div id="psw" class="easyui-dialog"
			style="width: 350px; height: 250px; padding: 10px 20px" closed="true"
			buttons="#dlg-buttons">
			<div class="ftitle">
				修改密码
			</div>
			<form id="fm" method="post" >
				<div>原来密码:<input type="password" name="oldpwd" class="easyui-validatebox key" required="true">
					</div><div>新密码:&nbsp;&nbsp;&nbsp;&nbsp;<input  type="password"  name="newpwd1" class="easyui-validatebox" required="true">
						</div><div>密码确认:<input  type="password"  name="newpwd2" class="easyui-validatebox" required="true"></div>
			</form>
		</div>
	<div id="dlg-buttons">
			<a href="#" class="easyui-linkbutton" iconCls="icon-ok"
				onclick="submitModifyPsw()">修改</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-cancel"
				onclick="javascript:$('#psw').dialog('close')">取消</a>
		</div>
	<script type="text/javascript">
	function modifyPsw(){
		$('#psw').dialog('open').dialog('setTitle', '修改密码');
		$('#fm').form('clear');
	}
	
	function submitModifyPsw() {
		$('#fm').form('submit', {
			url : '<%=basePath %>adminAction!modifyPwd.do',
			onSubmit : function() {
				return $(this).form('validate');
			},
			success : function(result) {
				var result = eval('(' + result + ')');
				//alert(result);
				if (result.message=='success') {
					$('#psw').dialog('close'); // close the dialog
			} else {
			$.messager.show( {
				title : '错误提示',
				msg : result.message
			});
		}
	}
		});
	}

	</script>	
</body>
</html>